import request from '@/utils/request'

/**
 * 获取权限点列表
 * @returns
 */
export const getPermissionListApi = () => {
  return request({
    url: '/sys/permission'
  })
}

/**
 * 删除权限点
 * @param {*} id
 * @returns
 */
export const delPermissionApi = (id) => {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}

/**
 * 新增
 * @param {*} data
 * @returns
 */
export const addPermissionApi = data => {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}

/**
 * 获取详细列表  回显
 * @param {*} id
 * @returns
 */
export const getPermissionDetailListApi = id => {
  return request({
    url: `/sys/permission/${id}`
  })
}

/**
 * 修改提交
 * @param {*} data
 * @returns
 */
export const editPermissionApi = data => {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}
